<template>
  <el-affix>
    <Header></Header>
  </el-affix>
  <router-view v-if="isRouterAlive"></router-view>
</template>

<script>
import Header from './components/Header.vue'
import { ref, provide, nextTick} from 'vue'
export default {
  name: 'App',
  components: {
    Header
  },
  setup() {
    const isRouterAlive = ref(true)
    const reload = () => {
      isRouterAlive.value = false
      nextTick(() => {
        isRouterAlive.value = true
      })
    }
    provide("reload", reload)
    return {
      isRouterAlive
    }
  }
}
</script>

<style>
html {
  height: 100%;
}
body {
  margin: 0;
  height: 100%;
}
#app {
  height: 100%;
}
</style>
